package com.hainatong.jcmvvmbase.mainhome.fragment;

import android.os.Bundle;
import android.view.View;
import com.hainatong.jcmvvmbase.Constants;
import com.hainatong.jcmvvmbase.MvvmLazyFragment;
import com.hainatong.jcmvvmbase.R;
import com.hainatong.jcmvvmbase.databinding.FragmentCommonResultBinding;
import com.hainatong.mvvmbase.base.NoViewModel;

public class CommonResultFragment extends MvvmLazyFragment<FragmentCommonResultBinding, NoViewModel>
{
    private int mResultType = 0;
    public static CommonResultFragment newInstance( int resultType )
    {
        CommonResultFragment resultFragment = new CommonResultFragment();
        Bundle bundle = new Bundle();
        bundle.putInt(Constants.COMMON_RESULT_TYPE,resultType);
        resultFragment.setArguments(bundle);
        return resultFragment;
    }


    @Override
    protected void initParameters()
    {
        Bundle args = getArguments();
        if( args != null && args.size() > 0)
        {
            mResultType = args.getInt(Constants.COMMON_RESULT_TYPE , 0);
        }
    }

    @Override
    public int getLayoutId()
    {
        return R.layout.fragment_common_result;
    }

    @Override
    public int getBindingVariable()
    {
        return 0;
    }

    @Override
    protected void onRetryBtnClick()
    {
    }

    @Override
    protected void initView(View view)
    {
        viewDataBinding.tvResult.setText( "成功添加商品入库" );
        viewDataBinding.btnGoOn.setVisibility( View.VISIBLE );
        viewDataBinding.btnGoOn.setOnClickListener( v -> {

        } );
        viewDataBinding.btnGoBack.setVisibility( View.VISIBLE );
        viewDataBinding.btnGoBack.setOnClickListener( v -> {

        } );



    }
}
